/**
 * Created by cherry
 */

import api from '../../api/api';
import * as types from '../mutation';


const state = {
  order:{
    orderedList:[]
  }
};

const getters = {
    allOrderedList: state => state.order.orderedList
};

const actions = {
    getOrderedAll({commit}){
      api.getAllOrderedList((res)=>{
          commit(types.ALL_ORDERED_LIST_SUCCESS,{res});
      });
    }
}

const mutations = {
    [types.ALL_ORDERED_LIST_SUCCESS](state,{res}){
      state.order.orderedList=res;
    }
};


export default{
    state,
    getters,
    actions,
    mutations
}
